package cn.biplam.front.component.data.tree;

import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.front.template.control.Tree.TreeID_Index;

/**
 *  树节点ID解析类,用于将树节点的页面ID解析成节点信息
 * @author XiaoRuxing Oct 22, 20093:17:11 PM
 * @version 1.0
 */
public class TreeNodeId {
	
	/** 索引表ID */
	private String indexNodeID;
	/** 节点对应的物理表ID */
	private String realID;
	/** 节点的级别 */
	private String indexNodeLevel;

	/**
	 * 传入节点ID创建索引表树节点ID解析类
	 * @param recordID 索引表树节点ID
	 * @throws ErrorMessage
	 */
	public TreeNodeId(String recordID) throws ErrorMessage{
		String[] node = recordID.split(",");
		if(node.length!=9){
			throw new ErrorMessage(" NodeID:"+recordID+" is not a tree node ID !");
		}
		indexNodeID = node[TreeID_Index.NodeID.toInt()];
		realID = node[TreeID_Index.NodeRealId.toInt()];
		indexNodeLevel = node[TreeID_Index.NodeLevel.toInt()];
	}

	/**
	 *  
	 * @return 节点ID
	 */
	public String getIndexNodeID() {
		return indexNodeID;
	}

	/**
	 *  
	 * @return 节点真实ID
	 */
	public String getRealID() {
		return realID;
	}

	/**
	 *  
	 * @return 节点级别
	 */
	public String getIndexNodeLevel() {
		return indexNodeLevel;
	}
}
